home *** CD-ROM | disk | FTP | other *** search
/ United Public Domain Gold 2 / United Public Domain Gold 2.iso / utilities / pu494.dms / pu494.adf / MANDDEMO / arexx / PrintCommands.mnd2 < prev    next >
Text File  |  1993-08-18  |  2KB  |  56 lines

  1. /* This script is supplied with the Mand2000 demo and release */
  2. /* versions and may be freely distributed. */
  3.  
  4. /* Print the available commands of the current project, or the */
  5. /* entire program.  Pass 'project' or 'global' as a parameter. */
  6. /* Default is global. */
  7.  
  8. /* Typically this command is run from the menus which are */
  9. /* installed by the default startup.mnd2 script. */
  10.  
  11. portname = address()    /* Retrieve the current port name. */
  12. /* If the portname does not start with MAND2000 then this script must */
  13. /* have been run with rx, rather than from Mand2000.  Therefore we */
  14. /* need to set the port name.  We do not always set the port name */
  15. /* because it is better to let Mand2000 set it for us, so that */
  16. /* this script can be used with windows other than the one with */
  17. /* port name MAND2000.1. */
  18. if (left(portname, 8) ~= "MAND2000") THEN
  19.     address 'MAND2000.1'
  20.  
  21. options results
  22.  
  23. say
  24.  
  25. /* Get the argument passed to this script. */
  26. parse arg command
  27.  
  28. if (command = PROJECT) THEN DO
  29.     say "   Project commands are:"
  30.     /* Ask for the list of available commands. */
  31.     help
  32.     CommandList = result
  33.     numcommands = Words(CommandList)
  34.     /* Ask for help on all commands. */
  35.     do command = 1 to numcommands
  36.         Word(CommandList, command) "?"
  37.         say result
  38.         END
  39.     END
  40. ELSE DO
  41.     address MAND2000
  42.  
  43.     say "   Global commands are:"
  44.     /* Ask for the list of available commands. */
  45.     help
  46.     CommandList = result
  47.     numcommands = Words(CommandList)
  48.     /* Ask for help on all commands. */
  49.     do command = 1 to numcommands
  50.         Word(CommandList, command) "?"
  51.         say result
  52.         END
  53.     END
  54.  
  55. exit
  56.